package com.youhome.model;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import org.springframework.util.StringUtils;

@Data
@ApiModel
@JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL)
public class CounselorRecommendHouse {

    @ApiModelProperty(value = "ID")
    private Long id;

    @ApiModelProperty(value = "顾问ID")
    @JsonIgnore
    private Long counselorId;

    @ApiModelProperty(value = "客户ID")
    @JsonIgnore
    private Long clientId;

    @ApiModelProperty(value = "房源ID")
    private String houseId;

    @ApiModelProperty(value = "房源地址")
    private String address;

    @ApiModelProperty(value = "房源价格")
    private Double price;

    @ApiModelProperty(value = "卧室数量")
    private Integer bed;

    @ApiModelProperty(value = "卫浴数量")
    private Integer bath;

    @ApiModelProperty(value = "图片")
    private String photo;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "修改时间")
    @JsonIgnore
    private Date updateTime;

    @ApiModelProperty(value = "是否删除")
    @JsonIgnore
    private Boolean isDelete;

    @ApiModelProperty(value = "备注")
    private String remark;

    public String getPhoto() {
        if (!StringUtils.isEmpty(photo)) {
            photo = "http://youhome-report.oss-cn-zhangjiakou.aliyuncs.com" + photo;
        }
        return photo;
    }
}